home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / manuals / newbies guide to softice / si-ug-chapter04.txt < prev    next >
Text File  |  1999-04-07  |  12KB  |  313 lines

  1. CHAPTER 4 - Using Break Point Commands
  2.  
  3.      04.00 Notationnal Conventions
  4.      04.01 Introduction
  5.      04.02 Setting Break Points
  6.      04.03 Manipulating Break Points
  7.  
  8. 04.00 Notationnal Conventions
  9.  
  10.      Section II contains syntax listings for each Soft-ICE command, and
  11.      explanations and examples for each command. All numbers are in
  12.      hexadecimal; any number can be an expression using +,-,/,*, or
  13.      registers. All commands are case-insensitive. Words that are in
  14.      italics the command syntax statements must be replaced by an actual
  15.      value, rather than typing in the italicized word.
  16.  
  17.      The following notational conventions are used throughout this section
  18.  
  19.      [ ]
  20.           Brackets enclose an optional syntax item.
  21.      < >
  22.           Angle brackets enclose a list of items or choices.
  23.      x | y
  24.           Vertical bars separate alternatives. Use item x or item y.
  25.      count
  26.           Count is a byte value that specifies the number of time break
  27.           point conditions must be met before the actual break point
  28.           occurs. If no count is specified, the default value is 1. Each
  29.           time the Soft-ICE window is brought up, the counts are reset to
  30.           the values originally specified.
  31.      verb
  32.           Verb is a value that specifies what type access the break point
  33.           will apply to. It can be set to 'R' for reads, 'W' for write RW'
  34.           for reads and writes, or 'X' for execute.
  35.      address
  36.           Address is a value that is made of two 16-bit words, separated by
  37.           a colon. The first word is the segment address, and the second
  38.           word is the segment offset. The addresses can be constructed of
  39.           registers expressions, and symbols. The address may also contain
  40.           the special characters "$", ".", and "@". See section 3-8
  41.           (Command Syntax) for a description of these special characters.
  42.      break-#
  43.           Break-number is an identification number that identifies the
  44.           break point to use when you are manipulating break points e.g.,
  45.           editing, deleting, enabling, or disabling them). The break-number
  46.           can be a hexadecimal digit from 0 to F.
  47.      list
  48.           List is a series of break-# separated by commas or spaces.
  49.      mask
  50.           Mask is a bitmask that is represented as: combination of 1's,
  51.           0's, and X's. X's are don't-care bits.
  52.      GT, LT GT and LT
  53.           Command qualifiers that unsigned comparisons of values.
  54.  
  55.      Example : BPIO 21 W EQ M 1XXX XXXX
  56.  
  57.      This command will cause a break point to occur if port 21H is written
  58.      to with the high order bit set.
  59.  
  60. 04.01 Introduction
  61.  
  62.      Soft-ICE has break point capability that has traditionally only been
  63.      available with hardware debuggers. The power and flexibility of the
  64.      80386 chip allows advanced break point capability without additional
  65.      hardware.
  66.  
  67.      Break points can be set on memory location reads and writes, memory
  68.      range reads and writes, program execution and port accesses. Soft-ICE
  69.      assigns a one-digit hexadecimal number (0-F) to each break point. This
  70.      break-number is used to identify break points when you set delete,
  71.      disable, enable, or edit them.
  72.  
  73.      All of Soft-ICE's break points are sticky. That means they don't
  74.      disappear automatically after they've been used; you must
  75.      intentionally clear or disable them using the BC or the BD commands.
  76.      Soft-ICE can handle 16 break points at one time. You can have up to
  77.      ten break points of a single type except for break points on memory
  78.      location (BPMs), of which you can only have four, due to restrictions
  79.      of the 80386 processor.
  80.  
  81.      Break points can be specified with a count parameter. The count
  82.      parameter tells Soft-ICE how many times the break point should be
  83.      ignored before the break point action occurs.
  84.  
  85. 04.02 Setting Break Points
  86.  
  87.      BPM, BPMB, BPMW, BPMD Set break point on memory access or execution
  88.      BPR Set break point on memory range
  89.      BPIO Set break point on I/O port access
  90.      BPINT Set break point on interrupt
  91.      BPX Set/clear break point on execution
  92.      CSIP Set CS:IP range qualifier
  93.      BPAND Wait for multiple break points to occur
  94.  
  95. Set break point on memory access or execution
  96.  
  97.      Syntax :
  98.  
  99.           BPM[size]address[verb][qualifier value][C=count]
  100.  
  101.           Size :
  102.                B(yte), W(ord), D(oubleword)
  103.                The size is actually a range covered by this break point.
  104.                For example, if double word is used, and the third byte of
  105.                the double is modified, then a break point will occur. The
  106.                size is also important if the optional qualifier is
  107.                specified (see below).
  108.           Verb :
  109.                R, W, RW, or X
  110.           Qualifier :
  111.                EQ(ual), NE (Not Equal), GT (Greater than), LT (Less Than),
  112.                M (Mask)
  113.                These qualifiers are only applicable to the read and write
  114.                break points.
  115.           Value
  116.                A byte, word, or double word value, depending on the size
  117.                specified.
  118.  
  119.      Comments :
  120.  
  121.           The BPM commands allow you to set a break point on memory reads
  122.           or writes or execution.
  123.  
  124.           If a verb is not specified, RW is the default. If a size is not
  125.           specified, byte is the default.
  126.  
  127.           All of the verb types except X cause the program to execute the
  128.           instruction that caused the break point. The current CS:IP will
  129.           be the instruction after the break point. If the verb type is X,
  130.           the current CS:IP will be the instruction where the break point
  131.           was set.
  132.  
  133.           If R is specified, then the break point will occur on read access
  134.           and on write operations that do not change the value of the
  135.           memory location.
  136.  
  137.           If the verb type is R, W or RW, executing an instruction at the
  138.           specified address will not cause the break point action to occur.
  139.  
  140.      Notes :
  141.  
  142.           If BPMW is used, the specified address must start on a word
  143.           boundary. If BPMD is used, the specified address must point to a
  144.           double word boundary.
  145.  
  146.      Example :
  147.  
  148.           BPM 1234:SI W EQ 10 C=3
  149.  
  150.           This command defines a break point on memory byte access. The
  151.           third time that 10 hexadecimal is written to location 1234:SI,
  152.           the break point action will occur.
  153.  
  154.           BPM CS:1235 X
  155.  
  156.           This command defines a break point on execution. The break point
  157.           action will occur the first time that the instruction at address
  158.           CS:1235 is reached. The current CS:IP will be the instruction
  159.           where the break point was set.
  160.  
  161.           BPMW DS:FOO W EQ M 0XXX XXXX XXXX XXX1
  162.  
  163.           This command defines a word break point on memory write. The
  164.           break point action will occur the first time that location DS:FOO
  165.           has a value written to it that sets the high order bit to 0 and
  166.           the low order bit to 1. The other bits can be any value.
  167.  
  168.           BPM DS:1000 W GT 5
  169.  
  170.           This command defines a byte break point on memory write. The
  171.           break point action will occur the first time that location
  172.           DS:1000 has a value written to it that is greater than 5.
  173.  
  174. Set break point on memory range
  175.  
  176.      Syntax :
  177.  
  178.           BPR start-address end-address [verb] [C=count]
  179.  
  180.           Start-address, end-address :
  181.                start-address and end-address specify memory range.
  182.           Verb :
  183.                R, W, RW, T or TW
  184.  
  185.      Comments :
  186.  
  187.           The BPR command allows you to set a break point across a range of
  188.           memory.
  189.  
  190.           All of the verb types except T or TW cause the program to execute
  191.           the instruction that caused the break point. The current CS:IP
  192.           will be the instruction after the break point.
  193.  
  194.           There is no range break point on execution. If a range break
  195.           point is desired on execution, R must be used. An instruction
  196.           fetch is considered a read for range break points.
  197.  
  198.           If a verb is not specified, W is the default.
  199.  
  200.           The range break point will degrade system performance in certain
  201.           circumstances. Any read or write within the 4K page that contains
  202.           the break point range is analyzed by Soft-ICE. This performance
  203.           degradation is usually not noticeable, however, degradation could
  204.           be extreme in exception cases.
  205.  
  206.           The T and TW verbs enable back trace ranges on the specified
  207.           range. They do not cause break points, but instead log
  208.           instruction information that can be displayed later with the SHOW
  209.           or TRACE commands. For more information on back trace ranges, see
  210.           chapter 9.
  211.  
  212.      Example :
  213.  
  214.           BPR B000:0 B000:1000 W
  215.  
  216.           This command defines a break point on memory range. The break
  217.           point will occur if there are any writes to the monochrome
  218.           adapter video memory region.
  219.  
  220. Set break point on I/O port access
  221.  
  222.      Syntax :
  223.  
  224.           BPIO port [verb] [qualifier value] [C=count]
  225.  
  226.           Port :
  227.                A byte or word value.
  228.           Verb :
  229.                R (IN), W (OUT), or RW
  230.           Qualifier :
  231.                EQ(ual), NE (Not Equal), GT (Greater than), LT (Less Than),
  232.                M (Mask)
  233.  
  234.      Comments :
  235.  
  236.           The BPIO command allows you to set a break point on I/O port
  237.           reads or writes.
  238.  
  239.           If value is specified, it is compared with the actual data value
  240.           read or written by the IN or OUT instruction causing the break
  241.           point. The value may be a byte or a word. If the I/O is to a byte
  242.           port, then the lower 8 bits are used in the comparison.
  243.  
  244.           The instruction pointer (CS:IP) will point to the instruction
  245.           after the IN or OUT instruction that caused the break point.
  246.  
  247.           If a verb is not specified, RW is the default.
  248.  
  249.      Example :
  250.  
  251.           BPIO 21 W NE FF
  252.  
  253.           This command defines a break point on I/O port access. The break
  254.           point will occur if the interrupt controller one mask register is
  255.           written with a value other than FFH.
  256.  
  257.           BPIO 3FE R EQ M 11XX XXXX
  258.  
  259.           This command defines a byte break point on I/O port read. The
  260.           break point action will occur the first time that I/0 port 3FE is
  261.           read with a value that has the two high order bits set to 1. The
  262.           other bits can be any value.
  263.  
  264. Set break point on interrupt
  265.  
  266.      Syntax :
  267.  
  268.           BPINT int-number [ < AL | AH | AX >= value] [C = count]
  269.  
  270.           Int-number :
  271.                Interrupt number from 0 - FF hex
  272.           Value :
  273.                A byte or a word value
  274.  
  275.      Comments :
  276.  
  277.           The BPINT command allows breaking on the execution of a hardware
  278.           or a software interrupt. By optionally qualifying the AX register
  279.           with a value, specific DOS or BIOS calls can be easily isolated.
  280.  
  281.           If no value is specified, a break point will occur when the
  282.           interrupt specified by int-number occurs. This interrupt can be a
  283.           hardware, software, or internal interrupt.
  284.  
  285.           The optional value is compared with the specified register (AH,
  286.           AL, or AX) when the interrupt occurs. If the value matches the
  287.           specified register, then the break point will occur.
  288.  
  289.           When the break point occurs, if the interrupt was a hardware
  290.           interrupt, the instruction pointer (CS:IP) will point to the
  291.           first instruction within the interrupt routine. The INT? command
  292.           can be used to see where execution was when the interrupt
  293.           occurred. If the interrupt was a software interrupt, when the
  294.           break point occurs, the instruction pointer (CS:IP) will point to
  295.           the INT instruction causing the interrupt.
  296.  
  297.      Example :
  298.  
  299.           BPINT 21 AH=4C
  300.  
  301.           This command defines a break point on interrupt 21H The break
  302.           point will occur when DOS function call 4CH (terminate program)
  303.           is called.
  304.  
  305. Set/Clear break point on execution
  306.  
  307.      Syntax :
  308.  
  309.           BPX [address] [C=count]
  310.  
  311.      Comments :
  312.  
  313.           The BPX command allows you to set or clear a poin